﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Logger
{
    // 使用说明
    // https://blog.csdn.net/liyou123456789/article/details/125392815
    // 需要将 NLog.config 文件始终复制
    public static class Logs
    {
        private static readonly NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger();

        public static void LogTrace(string message)
        {
            _logger.Trace(message);
        }

        public static void LogWarning(string message)
        {
            _logger.Warn(message);
        }

        public static void LogError(string message)
        {
            _logger.Error(message);
        }

        public static void LogFatal(string message)
        {
            _logger.Fatal(message);
        }

        public static void LogInfo(string message)
        {
            _logger.Info(message);
        }

        public static void LogError(Exception exception)
        {
            LogError(exception.Message + exception.StackTrace);
        }
    }
}
